package com.linuxgt.mobile;

import java.io.IOException;
import java.util.Properties;

/**
 * Created with IntelliJ IDEA.
 * User: LIUTENG
 * Date: 13-5-23
 * Time: 下午5:59
 * To change this template use File | Settings | File Templates.
 */
public class weixinProperties {
    private static weixinProperties ref; // 为了能创建单例模式
    private Properties prop = null;

    private weixinProperties() throws IOException {
        prop = new Properties();   //创建一个Properties 类的引用
        prop.load(weixinProperties.class.getResourceAsStream("/wx/weixin.properties")); //加载配置文件
    }

    public static weixinProperties getInstance() throws IOException {
        if(ref==null){
            ref= new weixinProperties();
        }
            return ref;
    }

    public static void main(String[] args) throws IOException {
        System.out.println(weixinProperties.getInstance().prop.get("a"));
        System.out.println(weixinProperties.getInstance().prop.get("b"));
    }
}
